package org.jeecg.modules.yusuan.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

@Getter
@Setter
public class NianDuHuiZong {

    private String deptId;

    private String categoryId;
    private String categoryName;
    private Boolean isLeaf;
    private String srHeji;//收入合计
    private String srBiaozhun;
    private String srXiangmu;
    private String srLiuyong;
    private String srShangnian;

    private String zcHeji;
    private String zcBiaozhun;
    private String zcXiangmu;
    private String zcZhijie;

    private String jiezhuan;

    private String parentId;

    private String jzbiaozhun;
    private String jzshangnian;
    private String jzxiangmu;
    private String jzliuyong;

    private String memo;

    private Boolean display = false;

    private List<NianDuHuiZong> children;

    @Override
    public boolean equals(Object obj) {
        if (obj == null){
            return false;
        }
        if (this == obj){
            return true;
        }
        if (obj instanceof NianDuHuiZong){
            NianDuHuiZong o = (NianDuHuiZong) obj;
            if(this.categoryId != null) {
                return StringUtils.equals(this.categoryId, o.categoryId);
            }else{
                return StringUtils.equals(this.categoryName, o.categoryName);
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        if(this.categoryId != null)
            return this.categoryId.hashCode();
        else{
            return this.categoryName.hashCode();
        }
    }
}
